<template>
  <div class="common-layout">
    <el-container>
      <el-header class="box">
        <div class="btn-1">
          <div class="box-1">
            <span @click="huanzhe"  class="btn">患者病例</span>
            <span @click="lishi"  class="btn">历史病例</span>
          </div>
          <div>
            <span  class="btn-2" >保存</span>
            <span  class="btn-2" @click="gotoo" >返回</span>
          </div>
        </div>
      </el-header>
      <el-main>
        <vue1 v-if="flag"/>
  <vue2 v-if="!flag"/>
      </el-main>
    </el-container>
  </div>
  <!-- <button @click="huanzhe">huanzhe</button>
  <button @click="lishi">lishi</button> -->
  <!-- <vue1 v-if="flag"/>
  <vue2 v-if="!flag"/> -->
</template>

<script lang="ts">
import vue1 from "@/components/patient/1.vue"
import vue2 from "@/components/patient/2.vue"
import {ref} from "vue"
import {useRouter} from 'vue-router';
  export default {
    components:{
      vue1,
      vue2
    }
      
    ,
    setup () {
      //实例化路由
      const router=useRouter();
      function gotoo(){
        router.push({
          path: '/treat/patientList'
        })
      }
        const flag=ref(true)
        const huanzhe = ()=>{
          flag.value=true
        }
        const lishi = ()=>{
          flag.value=false
        }
        return {huanzhe,lishi,flag,gotoo}
    }
}
</script>

<style>
.btn {
  background-color: #00aaff;
  border-color: #00a0f0;
  border-radius: 2px;
  padding: 6px 22px;
  color: #fff;
  float: left;
  display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
}
.btn-2 {
  background-color: #00aaff;
  border-color: #00a0f0;
  border-radius: 2px;
  padding: 6px 22px;
  float: right;
  color: #fff;
  margin-left: 10px;
  display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
}
.box-1 {
 margin-bottom: 10px;
}
.box{
  margin-left: 20px;
  width: 100%;
  
}
</style>